<template>
  <router-view v-if="isRouterAlive" />
</template>

<script setup>
  import useSettingsStore from '@/store/modules/settings'
  import {
    handleThemeStyle
  } from '@/utils/theme'
  import {
    provide,
    ref,
    nextTick
  } from "vue";
  const isRouterAlive = ref(true);
  const reload = () => {
    isRouterAlive.value = false;
    nextTick(() => {
      isRouterAlive.value = true
    })
  }
  provide("reload", reload);
  onMounted(() => {
    nextTick(() => {
      // 初始化主题样式
      handleThemeStyle(useSettingsStore().theme)
    })
  })
</script>